Optimal. Leaf size=174 \[ \frac {(4 A-4 B+3 C) \sin ^3(c+d x)}{3 a d}-\frac {(4 A-4 B+3 C) \sin (c+d x)}{a d}+\frac {(5 A-4 B+4 C) \sin (c+d x) \cos ^3(c+d x)}{4 a d}+\frac {3 (5 A-4 B+4 C) \sin (c+d x) \cos (c+d x)}{8 a d}-\frac {(A-B+C) \sin (c+d x) \cos ^3(c+d x)}{d (a \sec (c+d x)+a)}+\frac {3 x (5 A-4 B+4 C)}{8 a} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.21, antiderivative size = 174, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 5, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.122, Rules used = {4084, 3787, 2635, 8, 2633} \[ \frac {(4 A-4 B+3 C) \sin ^3(c+d x)}{3 a d}-\frac {(4 A-4 B+3 C) \sin (c+d x)}{a d}+\frac {(5 A-4 B+4 C) \sin (c+d x) \cos ^3(c+d x)}{4 a d}+\frac {3 (5 A-4 B+4 C) \sin (c+d x) \cos (c+d x)}{8 a d}-\frac {(A-B+C) \sin (c+d x) \cos ^3(c+d x)}{d (a \sec (c+d x)+a)}+\frac {3 x (5 A-4 B+4 C)}{8 a} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2633
Rule 2635
Rule 3787
Rule 4084
Rubi steps
\begin {align*} \int \frac {\cos ^4(c+d x) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right )}{a+a \sec (c+d x)} \, dx &=-\frac {(A-B+C) \cos ^3(c+d x) \sin (c+d x)}{d (a+a \sec (c+d x))}+\frac {\int \cos ^4(c+d x) (a (5 A-4 B+4 C)-a (4 A-4 B+3 C) \sec (c+d x)) \, dx}{a^2}\\ &=-\frac {(A-B+C) \cos ^3(c+d x) \sin (c+d x)}{d (a+a \sec (c+d x))}-\frac {(4 A-4 B+3 C) \int \cos ^3(c+d x) \, dx}{a}+\frac {(5 A-4 B+4 C) \int \cos ^4(c+d x) \, dx}{a}\\ &=\frac {(5 A-4 B+4 C) \cos ^3(c+d x) \sin (c+d x)}{4 a d}-\frac {(A-B+C) \cos ^3(c+d x) \sin (c+d x)}{d (a+a \sec (c+d x))}+\frac {(3 (5 A-4 B+4 C)) \int \cos ^2(c+d x) \, dx}{4 a}+\frac {(4 A-4 B+3 C) \operatorname {Subst}\left (\int \left (1-x^2\right ) \, dx,x,-\sin (c+d x)\right )}{a d}\\ &=-\frac {(4 A-4 B+3 C) \sin (c+d x)}{a d}+\frac {3 (5 A-4 B+4 C) \cos (c+d x) \sin (c+d x)}{8 a d}+\frac {(5 A-4 B+4 C) \cos ^3(c+d x) \sin (c+d x)}{4 a d}-\frac {(A-B+C) \cos ^3(c+d x) \sin (c+d x)}{d (a+a \sec (c+d x))}+\frac {(4 A-4 B+3 C) \sin ^3(c+d x)}{3 a d}+\frac {(3 (5 A-4 B+4 C)) \int 1 \, dx}{8 a}\\ &=\frac {3 (5 A-4 B+4 C) x}{8 a}-\frac {(4 A-4 B+3 C) \sin (c+d x)}{a d}+\frac {3 (5 A-4 B+4 C) \cos (c+d x) \sin (c+d x)}{8 a d}+\frac {(5 A-4 B+4 C) \cos ^3(c+d x) \sin (c+d x)}{4 a d}-\frac {(A-B+C) \cos ^3(c+d x) \sin (c+d x)}{d (a+a \sec (c+d x))}+\frac {(4 A-4 B+3 C) \sin ^3(c+d x)}{3 a d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 0.99, size = 393, normalized size = 2.26 \[ \frac {\sec \left (\frac {c}{2}\right ) \cos \left (\frac {1}{2} (c+d x)\right ) \left (72 d x (5 A-4 B+4 C) \cos \left (c+\frac {d x}{2}\right )+72 d x (5 A-4 B+4 C) \cos \left (\frac {d x}{2}\right )-168 A \sin \left (c+\frac {d x}{2}\right )-120 A \sin \left (c+\frac {3 d x}{2}\right )-120 A \sin \left (2 c+\frac {3 d x}{2}\right )+40 A \sin \left (2 c+\frac {5 d x}{2}\right )+40 A \sin \left (3 c+\frac {5 d x}{2}\right )-5 A \sin \left (3 c+\frac {7 d x}{2}\right )-5 A \sin \left (4 c+\frac {7 d x}{2}\right )+3 A \sin \left (4 c+\frac {9 d x}{2}\right )+3 A \sin \left (5 c+\frac {9 d x}{2}\right )-552 A \sin \left (\frac {d x}{2}\right )+168 B \sin \left (c+\frac {d x}{2}\right )+144 B \sin \left (c+\frac {3 d x}{2}\right )+144 B \sin \left (2 c+\frac {3 d x}{2}\right )-16 B \sin \left (2 c+\frac {5 d x}{2}\right )-16 B \sin \left (3 c+\frac {5 d x}{2}\right )+8 B \sin \left (3 c+\frac {7 d x}{2}\right )+8 B \sin \left (4 c+\frac {7 d x}{2}\right )+552 B \sin \left (\frac {d x}{2}\right )-96 C \sin \left (c+\frac {d x}{2}\right )-72 C \sin \left (c+\frac {3 d x}{2}\right )-72 C \sin \left (2 c+\frac {3 d x}{2}\right )+24 C \sin \left (2 c+\frac {5 d x}{2}\right )+24 C \sin \left (3 c+\frac {5 d x}{2}\right )-480 C \sin \left (\frac {d x}{2}\right )\right )}{192 a d (\cos (c+d x)+1)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.45, size = 132, normalized size = 0.76 \[ \frac {9 \, {\left (5 \, A - 4 \, B + 4 \, C\right )} d x \cos \left (d x + c\right ) + 9 \, {\left (5 \, A - 4 \, B + 4 \, C\right )} d x + {\left (6 \, A \cos \left (d x + c\right )^{4} - 2 \, {\left (A - 4 \, B\right )} \cos \left (d x + c\right )^{3} + {\left (13 \, A - 4 \, B + 12 \, C\right )} \cos \left (d x + c\right )^{2} - {\left (19 \, A - 28 \, B + 12 \, C\right )} \cos \left (d x + c\right ) - 64 \, A + 64 \, B - 48 \, C\right )} \sin \left (d x + c\right )}{24 \, {\left (a d \cos \left (d x + c\right ) + a d\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.22, size = 249, normalized size = 1.43 \[ \frac {\frac {9 \, {\left (d x + c\right )} {\left (5 \, A - 4 \, B + 4 \, C\right )}}{a} - \frac {24 \, {\left (A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{a} - \frac {2 \, {\left (75 \, A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 60 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 36 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 115 \, A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 124 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 84 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 109 \, A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 100 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 60 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 21 \, A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 36 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 12 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{4} a}}{24 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 1.38, size = 526, normalized size = 3.02 \[ -\frac {A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a d}+\frac {B \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a d}-\frac {C \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a d}-\frac {25 \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) A}{4 a d \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4}}-\frac {3 \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) C}{a d \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4}}+\frac {5 \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) B}{a d \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4}}-\frac {115 \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) A}{12 a d \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4}}-\frac {7 \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) C}{a d \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4}}+\frac {31 \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) B}{3 a d \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4}}-\frac {109 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) A}{12 a d \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4}}-\frac {5 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) C}{a d \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4}}+\frac {25 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) B}{3 a d \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4}}-\frac {7 A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 a d \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4}}-\frac {C \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a d \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4}}+\frac {3 B \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a d \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4}}+\frac {15 A \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 a d}-\frac {3 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) B}{a d}+\frac {3 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) C}{a d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.48, size = 525, normalized size = 3.02 \[ -\frac {A {\left (\frac {\frac {21 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {109 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {115 \, \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} + \frac {75 \, \sin \left (d x + c\right )^{7}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{7}}}{a + \frac {4 \, a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {6 \, a \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} + \frac {4 \, a \sin \left (d x + c\right )^{6}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{6}} + \frac {a \sin \left (d x + c\right )^{8}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{8}}} - \frac {45 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} + \frac {12 \, \sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}\right )} - 4 \, B {\left (\frac {\frac {9 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {16 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {15 \, \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}}}{a + \frac {3 \, a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {3 \, a \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} + \frac {a \sin \left (d x + c\right )^{6}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{6}}} - \frac {9 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} + \frac {3 \, \sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}\right )} + 12 \, C {\left (\frac {\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {3 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}}{a + \frac {2 \, a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {a \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}}} - \frac {3 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} + \frac {\sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}\right )}}{12 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 5.25, size = 189, normalized size = 1.09 \[ \frac {3\,x\,\left (5\,A-4\,B+4\,C\right )}{8\,a}-\frac {\left (\frac {25\,A}{4}-5\,B+3\,C\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\left (\frac {115\,A}{12}-\frac {31\,B}{3}+7\,C\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (\frac {109\,A}{12}-\frac {25\,B}{3}+5\,C\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (\frac {7\,A}{4}-3\,B+C\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left (a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+4\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+6\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+4\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+a\right )}-\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (A-B+C\right )}{a\,d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \frac {\int \frac {A \cos ^{4}{\left (c + d x \right )}}{\sec {\left (c + d x \right )} + 1}\, dx + \int \frac {B \cos ^{4}{\left (c + d x \right )} \sec {\left (c + d x \right )}}{\sec {\left (c + d x \right )} + 1}\, dx + \int \frac {C \cos ^{4}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}}{\sec {\left (c + d x \right )} + 1}\, dx}{a} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________